import Vue from 'vue'
import Vuex from 'vuex'
import storage from '../model/storage'
Vue.use(Vuex)

export default () => new Vuex.Store({
  state: {
    token:''
  },
  mutations: {
    set_token(state,token) {
      state.token = token;
      storage.set('token', token);
      console.log('store、localstorage保存token成功！');
    },
    del_token(state) {
      state.token = "";
      storage.remove("token");
    },
  },
  actions: {

  },
})
